


package controller;




import bo.BUS_ChiTietHoaDon;
import com.opensymphony.xwork2.ActionSupport;
import dto.DTO_ChiTietHoaDon;
import java.util.ArrayList;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;



public class ChonHDAction extends ActionSupport implements ServletRequestAware {

    private HttpServletRequest request;
    private ArrayList<DTO_ChiTietHoaDon> dscthd = new ArrayList<DTO_ChiTietHoaDon>();

    public ArrayList<DTO_ChiTietHoaDon> getDscthd() {
        return dscthd;
    }

    public void setDscthd(ArrayList<DTO_ChiTietHoaDon> dscthd) {
        this.dscthd = dscthd;
    }

    public ChonHDAction() {

    }



    public String execute() throws Exception {

        int MaHD = Integer.parseInt(request.getParameter("GiaTriTim"));
        BUS_ChiTietHoaDon busCTHD = new BUS_ChiTietHoaDon();
        dscthd = busCTHD.loadDSCTHD(MaHD);
        return "success";


    }

    @Override
    public void setServletRequest(HttpServletRequest hsr) {
        request = hsr;
    }



}